package com.mgq.design.decorator;

import java.io.BufferedInputStream;
import java.io.FileInputStream;
import java.io.InputStream;
import java.util.zip.GZIPInputStream;

/**
 * <b>功能：</b>测试类<br>
 * <b>Copyright mgq</b>
 * <li>版本&nbsp;&nbsp;&nbsp;&nbsp;修改日期&nbsp;&nbsp;&nbsp;&nbsp;部　　门&nbsp;&nbsp;&nbsp;&nbsp;作　者&nbsp;&nbsp;&nbsp;&nbsp;变更内容</li><hr>
 * <li>v1.0&nbsp;&nbsp;&nbsp;&nbsp;20220331&nbsp;&nbsp;营业后台&nbsp;&nbsp;&nbsp;&nbsp;马广奇&nbsp;&nbsp;&nbsp;&nbsp;创建类</li>
 * <br><br>
 *
 * @author 马广奇
 * @version 2022-03-31 18:31
 */
public class Test {
    public static void main(String[] args) {
        Shape circle = new Circle();
        //InputStream inputStream=new FileInputStream("Circle.class");
        //BufferedInputStream bufferedInputStream = new BufferedInputStream(inputStream);
        //GZIPInputStream gzipInputStream = new GZIPInputStream(bufferedInputStream);
        //GzipInputSteam又装饰了bufferInputStream
       // int read = gzipInputStream.read();

        Shape redCircle  = new RedShapeDecorator(new Circle());
        //类似FileInputStream
        Shape redRectangle = new RedShapeDecorator(new Rectangle());
        System.out.println("Circle with normal border");
        circle.draw();
        System.out.println("\nCircle of red border");
        redCircle.draw();

        System.out.println("\nRectangle of red border");
        redRectangle.draw();
    }

}
